# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: media-sound/odvr/odvr-0.1.5-r2.ebuild,v 1.0 2014/01/09 15:22:00 itspec.ru Exp $

EAPI="3"

inherit eutils

DESCRIPTION="User-space driver for USB-enabled Olympus DVRs that do not support the USB Mass Storage."
HOMEPAGE="http://code.google.com/p/odvr/"
SRC_URI="http://odvr.googlecode.com/files/${PN}-${PV}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
RESTRICT="mirror"

KEYWORDS="~x86 ~amd64"
IUSE=""

DEPEND="
        virtual/libusb
        media-libs/libsndfile"

RDEPEND="
        virtual/udev
        virtual/libusb
        media-libs/libsndfile"

src_prepare() {
    # patch from http://code.google.com/p/odvr/issues/detail?id=6
    epatch "${FILESDIR}/add_pulcod2_support_to_olympusdrv.patch" || die "patch failed"
}

src_compile() {
    emake || die "emake failed"
}

src_install() {
    dobin odvr
    dobin odvr-gui
    insinto /etc/udev/rules.d
    doins 41-odvr.rules
    dodoc README
}

pkg_postinst() {
    elog ""
    elog "You will need to reload udev rules prior running ${PN}:"
    elog "# udevadm control --reload-rules"
    elog ""
}
